package com.zoe.app;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Zoe.Zhang
 * @date 2021/10/10
 * @description 三种注册Filter的方式
 * 1: WebFilter + ServletComponentScan 注解
 * 2: 直接使用Component注解
 * 3: 使用FilterRegistrationBean
 */
@SpringBootApplication
@RestController
@ServletComponentScan(basePackages = {"com.**.app"})
public class MainAppRegisterFilter {
    public static void main(String[] args) {
        SpringApplication.run(MainAppRegisterFilter.class, args);
    }

    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }
}
